<template>
	<view class="container">
		<view class="top">
			<image class="image" src="@/static/morentouxiang.png"></image>
			<text>{{user.studentName}}</text>
		</view>
		<uni-list>
			<uni-list-item showExtraIcon="true" title="校区" :rightText="user.deptName" />
			<uni-list-item showExtraIcon="true" title="年级" :rightText="user.grade" />
			<uni-list-item showExtraIcon="true" title="准考证号" :rightText="user.idNumber" />
			<uni-list-item showExtraIcon="true" title="性别" :rightText="user.sex == 0 ? '男' : '女'" />
			<uni-list-item showExtraIcon="true" title="民族" :rightText="user.nation" />
			<uni-list-item showExtraIcon="true" title="专业" :rightText="user.major" />
			<uni-list-item showExtraIcon="true" title="家庭住址" :rightText="user.homeAddress" />
			<uni-list-item showExtraIcon="true" title="联系方式" :rightText="user.mobile" />
		</uni-list>
	</view>
</template>

<script>
	import {
		getStudentInfo
	} from "@/api/system/user"

	export default {
		data() {
			return {
				user: {},
				roleGroup: "",
				postGroup: ""
			}
		},
		onLoad() {
			this.getUser()
		},
		methods: {
			getUser() {
				getStudentInfo().then(response => {
					console.log(response.data);
					this.user = response.data
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background-color: #ffffff;
	}

	.top {
		margin-bottom: 25rpx;
		padding: 30rpx 50rpx;
		display: flex;
		align-items: center;

		.image {
			width: 80rpx;
			height: 80rpx;
			margin-right: 40rpx;
		}
	}
</style>